package com.example.clients;

import com.example.pojo.Inputs;
import com.example.pojo.Sx;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.List;


@FeignClient(name = "tools-server", url = "http://localhost:8091")
public interface AllToolsClient {

    @PostMapping(value = "/tools/oss", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String uploadFile(@RequestPart(value = "file") MultipartFile file);

    @GetMapping("/tools/del")
    String Del(@RequestParam("objectName") String objectName);

    @GetMapping("/tools/msg")
    String xzs(@RequestParam("msg") String msg);

    @GetMapping("/tools/pay")  // 订单id（不能重复）和消费金额
    void pay(@RequestParam("orderId") String orderId,@RequestParam("cost") String cost,@RequestParam("uid") Integer uid, HttpServletResponse response);

    @GetMapping("/tools/getSx")
    List<Sx> getSx(@RequestParam("title") String  title) ;

    @GetMapping("/tools/makeSx")
    String makeSx(@RequestParam("userid") String  userid,@RequestParam("title") String title,
                           @RequestParam("message") String message) ;
}
